<ui:composition template="/publico/template.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html">
    <ui:define name="content">
        <h:form id="fprincipal">
            <p:messages/>
            <p:panel id="pprincipal"
                     header="Local">
                <h:inputHidden id="ihlocal"
                               value="#{localBean.local.id}" />
                
                <h:panelGrid id="pgprincipal"
                             columns="2">  
                    <p:outputLabel
                        id="ollocal"
                        for="itlocal" 
                        value="Local: "/>
                    <p:inputText 
                        id="itlocal" 
                        value="#{localBean.local.nome}"
                        required="true"/>
                    <p:outputLabel
                        id="oldetalhes"
                        for="itdetalhes" 
                        value="Detalhes: "/>
                    <p:inputTextarea 
                        id="itdetalhes" 
                        value="#{localBean.local.descricao}"/>
                </h:panelGrid>

                <p>
                    <p:commandButton ajax="false" 
                                     id="cbsalvar"
                                     value="Salvar" 
                                     action="#{localBean.salvar}"/>

                    <p:button id="cbcancelar"
                              outcome="/admin/local/lista-local.xhtml"
                              value="Cancelar"/>
                </p>
            </p:panel>
        </h:form>
    </ui:define>
</ui:composition>